import { ref} from "vue"
// 图片上传
export const imgFun = () => {
		uni.chooseImage({
			count: 1,
			sizeType:['compressed'],
			sourceType: ['camera'],
			success: (res) => {
				loadingTrue.value=true;
				const tempFilePaths = res.tempFilePaths;
				let size = res.tempFiles[0].size; //上传图片大小
				let maxSize = 1024 * 1024 * 10; //最大可上传2mb
				if (size < maxSize) {
					uploadTheImg(tempFilePaths[0]);
				} else {
					uni.showModal({ title: '', showCancel: false, content: '单张图片不能超过10M大小' })
				}		
			}
		})
}